import {defineStore} from "pinia";
import {getListUser, login, register} from "@/apis/user";
import {ref, reactive} from 'vue'

export const useUserStore = defineStore('user', {
    state: () => {
        return {
            loginInfo: ref({}),

        }
    }, getters: {},
    actions: {
        async getUserInfo({username, password}) {
            const res = await login({username, password})
            this.loginInfo = res.data
            return res
        },
    },
    persist: true

})